/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author PARINYA
 */
@Entity
@Table(name = "m_specialist")
@NamedQueries({
    @NamedQuery(name = "MSpecialist.findAll", query = "SELECT m FROM MSpecialist m"),
    @NamedQuery(name = "MSpecialist.findById", query = "SELECT m FROM MSpecialist m WHERE m.id = :id"),
    @NamedQuery(name = "MSpecialist.findByName", query = "SELECT m FROM MSpecialist m WHERE m.name = :name")})
public class MSpecialist implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Long id;
    @Basic(optional = false)
    @Column(name = "Name")
    private String name;
    @Lob
    @Column(name = "Detail")
    private String detail;
    @OneToMany(mappedBy = "mSpecialist")
    private Collection<SrcCureplanDoctor> srcCureplanDoctorCollection;
    @OneToMany(mappedBy = "mSpecialist")
    private Collection<SrvCureplan> srvCureplanCollection;

    public MSpecialist() {
    }

    public MSpecialist(Long id) {
        this.id = id;
    }

    public MSpecialist(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public Collection<SrcCureplanDoctor> getSrcCureplanDoctorCollection() {
        return srcCureplanDoctorCollection;
    }

    public void setSrcCureplanDoctorCollection(Collection<SrcCureplanDoctor> srcCureplanDoctorCollection) {
        this.srcCureplanDoctorCollection = srcCureplanDoctorCollection;
    }

    public Collection<SrvCureplan> getSrvCureplanCollection() {
        return srvCureplanCollection;
    }

    public void setSrvCureplanCollection(Collection<SrvCureplan> srvCureplanCollection) {
        this.srvCureplanCollection = srvCureplanCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MSpecialist)) {
            return false;
        }
        MSpecialist other = (MSpecialist) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.MSpecialist[id=" + id + "]";
    }

}
